package com.zhang.bingmei_incomeexpenditure.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zhang.bingmei_incomeexpenditure.entity.commom.DataScope;
import com.zhang.bingmei_incomeexpenditure.entity.ie.*;
import com.zhang.bingmei_incomeexpenditure.entity.ie.selectNew.SelectDoubleResult;
import com.zhang.bingmei_incomeexpenditure.entity.ie.updateNew.UpdateDoubleDTO;
import com.zhang.bingmei_incomeexpenditure.entity.ie.updateNew.UpdateDoubleVO;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface IncomeExpenditureService extends IService<IncomeExpenditure> {

    //获取自己区域
    public DataScope getDataScopeByIE();

    List<CodeCityNameAndYearVO> getAllDistrict(IncomeExpenditurePageDTO dto);

    SelectDoubleResult getAllIEData(IncomeExpenditurePageDTO dto);

    // 根据DataScope的area字段模糊查询并去重
    List<String> listByDataScopeArea(DataScope dataScope, Integer userRole);

    // 根据返回的城市数据，遍历获取城市名称
    IncomeExpenditureResult getCityNamesByArea(String userRoleCity, List<String> areas, IncomeExpenditurePageDTO dto);

    // 根据返回的城市数据，遍历获取城市名称（返回含小数的数据）
    SelectDoubleResult getCityNamesByAreaToDouble(String userRoleCity,
                                                  List<String> areas, IncomeExpenditurePageDTO dto);

    //修改收支数据
    List<IncomeExpenditureDetailVO> batchUpdateIncomeExpenditureData(List<UpdateIncomeExpenditureDTO> updateList);

    //导出
    void exportIncomeExpenditure(IncomeExpenditurePageDTO pageDTO, HttpServletResponse response) throws Exception;

    IncomeExpenditureResult getIncomeExpenditureData(IncomeExpenditurePageDTO dto);
    SelectDoubleResult getIncomeExpenditureDoubleData(IncomeExpenditurePageDTO dto);

    List<UpdateDoubleVO> batchUpdateIncomeExpenditureDataLong(List<UpdateDoubleDTO> updateList);

    List<UpdateDoubleVO> batchUpdateIncomeExpenditureDataLong2(List<UpdateDoubleDTO> updateList);

    // 修改 + 新增
    List<IncomeExpenditureDetailVO> updateOrInsertIE(List<UpdateOrInsertIEDTO> dataList);

    // 获取所有数据
    List<IncomeExpenditure> getAllData();

    //获取当前用户管辖市辖区
    List<CodeNameVO> getDistricts();

}